#
# @lc app=leetcode.cn id=944 lang=python3
#
# [944] 删列造序
#

# @lc code=start
class Solution:
    def minDeletionSize(self, strs: List[str]) -> int:
        m, n = len(strs), len(strs[0])
        ans = 0
        for c in range(n):
            for r in range(1, m):
                if strs[r][c] < strs[r - 1][c]:
                    ans += 1
                    break
        return ans
# @lc code=end

